package com.ruoyi.safe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.safe.mapper.SurroundingEnvMapper;
import com.ruoyi.safe.domain.SurroundingEnv;
import com.ruoyi.safe.service.ISurroundingEnvService;

/**
 * 周边环境Service业务层处理
 * 
 * @author yxf
 * @date 2021-08-10
 */
@Service
public class SurroundingEnvServiceImpl implements ISurroundingEnvService 
{
    @Autowired
    private SurroundingEnvMapper surroundingEnvMapper;

    /**
     * 查询周边环境
     * 
     * @param seId 周边环境ID
     * @return 周边环境
     */
    @Override
    public SurroundingEnv selectSurroundingEnvById(Long seId)
    {
        return surroundingEnvMapper.selectSurroundingEnvById(seId);
    }

    /**
     * 查询周边环境列表
     * 
     * @param surroundingEnv 周边环境
     * @return 周边环境
     */
    @Override
    public List<SurroundingEnv> selectSurroundingEnvList(SurroundingEnv surroundingEnv)
    {
        return surroundingEnvMapper.selectSurroundingEnvList(surroundingEnv);
    }

    /**
     * 新增周边环境
     * 
     * @param surroundingEnv 周边环境
     * @return 结果
     */
    @Override
    public int insertSurroundingEnv(SurroundingEnv surroundingEnv)
    {
        surroundingEnv.setCreateTime(DateUtils.getNowDate());
        return surroundingEnvMapper.insertSurroundingEnv(surroundingEnv);
    }

    /**
     * 修改周边环境
     * 
     * @param surroundingEnv 周边环境
     * @return 结果
     */
    @Override
    public int updateSurroundingEnv(SurroundingEnv surroundingEnv)
    {
        surroundingEnv.setUpdateTime(DateUtils.getNowDate());
        return surroundingEnvMapper.updateSurroundingEnv(surroundingEnv);
    }

    /**
     * 批量删除周边环境
     * 
     * @param seIds 需要删除的周边环境ID
     * @return 结果
     */
    @Override
    public int deleteSurroundingEnvByIds(Long[] seIds)
    {
        return surroundingEnvMapper.deleteSurroundingEnvByIds(seIds);
    }

    /**
     * 删除周边环境信息
     * 
     * @param seId 周边环境ID
     * @return 结果
     */
    @Override
    public int deleteSurroundingEnvById(Long seId)
    {
        return surroundingEnvMapper.deleteSurroundingEnvById(seId);
    }
}
